<?php 

    class App_Plugin_Briefcase extends Zend_Controller_Plugin_Abstract{
    	
    	public function postDispatch(Zend_Controller_Request_Abstract $request){
    		 //Получение блокнота пользователя и подсчет записей
    		$user = \Managers\User::isLogged();
    		if($user){
    			$userId = $user->id;
    			$briefcaseManager = new \Managers\Briefcase();
                $added = $briefcaseManager->getAddedBriefcase($userId);
    	     	$briefcase = array();
                foreach($added as $added){
                    $briefcase[] = $added['autoId'];
                }
    		    $count = count($briefcase);
    			$layout = Zend_Layout::getMvcInstance();
           		$layout->assign('briefcase', $count);
           	}
       }
    }  